public class 二维数组 {
    public static void main(String[] args) {
        int[][] arr = new int[][]{
                {11, 22, 33},
                {22, 33, 44},
                {33, 44, 55}
        };
        for (int i = 0; i < arr.length; i++) {
            int sum = getSum(arr[i]);
            System.out.println("第" + (i + 1) + "行的总和为：" + sum);
        }
        int Sum = 0;
        for (int i = 0; i < arr.length; i++) {
            Sum += getSum(arr[i]);
        }
        System.out.println("二维数组的总和为：" + Sum);
    }
    public static int getSum(int[] arr){
        int sum = 0;
        for(int i = 0; i < arr.length; i++){
            sum += arr[i];
        }
        return sum;
    }
}
